import Vue from 'vue'
import Vuex from 'vuex'
Vue.use(Vuex)





const state={
    dingid:'',
    dingdan_houseid:'',
    yezhuInfo:{},
    caidanInfo:{},
    Info:{},
    loudongname:'',
    fangwuid:'',
    appview:'login',
    appView2:'home'
}
const mutations={
    updated5(state,yezhuinfo) {
        state.Info=yezhuinfo;
    },
    updated4(state,id) {
        state.dingid=id; 
     },
    updated3(state,id) {
       state.dingdan_houseid=id; 
    },
    updated2(state,yezhu) {
        state.yezhuInfo=yezhu;
    },
    updated(state,caidan) {
        state.caidanInfo=caidan;
    },
    updatefangwuid(state,id){
        state.fangwuid=id;
    },
    updateloudongname(state,name){
        state.loudongname=name;
    },
    update1(state,name){
        state.appview=name;
    },
    update2(state,url){
        state.appView2=url;
    }
}

const actions={
    changeOrderId({commit},id){
        commit("updated4",id);
    },
    changedingdan_houseid({commit},id){
        commit("updated3",id);
    },
    changeyezhuInfo({commit},yezhu){
        commit("updated2",yezhu);
    },
    change2({commit},caidan){
        commit("updated",caidan);
    },
    change({commit},yezhuinfo){
        commit("updated5",yezhuinfo);
    },
    changeId({commit},id){
        commit("updatefangwuid",id);
    },
    changeLogin({commit}){
        commit("update1","login");
    },
    changeIndex({commit}){
        commit("update1","index");
    },
    changeUrl({commit},url){
        commit("update2",url);
    },
    changeName({commit},name){
        commit("updateloudongname",name);
    }
}

export default new Vuex.Store({
    state,mutations,actions
});